/*************************************************************/
/*bg_final_analysis.do contains all STATA commands needed to reproduce the tables and figures for "Climate Risk and Preferences over the Size of Government." 

First run the python code all_gis_commands.py which uses ArcGIS to construct the relevant fire-block group measures which form the independent variable. Then run final_data_builder.do to construct the final dataset.

MC 11302022
*/
*************************************************************

clear all
set maxvar 32767
set matsize 10000

use bgfires.dta, clear

*clean data
drop if substr(bgkey, -1, 1)=="0"


replace demshare=demshare*100
replace repshare=repshare*100
replace env_share=env_share*100
replace incumshare=incumshare*100
replace biggovshare=biggovshare*100
replace liberal_share=liberal_share*100


*create fixed effects
destring bgkey, gen(bgkeynum)
gen yearfe = fips+stryear
destring yearfe, replace force

*generate the future fire placebo
gen placebo=0

sort bgkeynum year
replace placebo=bigfire[_n+1]
*need to do the last year 2018 separately
replace placebo=fire2020 if year==2018
replace placebo=0 if year==2018&fire2020==.

*find ever-treated BGs
by bgkeynum: egen everfire=max(bigfire)

*find total number of treatments
by bgkeynum: egen sumfires=sum(bigfire)

*find ever-in-buffer BGs
by bgkeynum: egen everbuff=max(in_buffer5k)

*find year of first fire for multiple treated BGs
gen fireyear=bigfire*year
replace fireyear=3000 if fireyear==0
by bgkeynum: egen firstfire=min(fireyear)
replace firstfire=. if firstfire==3000

*generate buffer rings
gen buff20k=0
replace buff20k=1 if in_buffer5k==0 & in_buffer20k==1
gen fivekonly=0
replace fivekonly=1 if in_buffer5k==1 & bigfire==0

*generate democratic registration and turnout variables
gen demreg=(bdem/btotreg_r)*100
gen turnout= (bv_totreg_r/ btotreg_r)*100


*Make table 2
reghdfe biggovshare bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t1.xls
reghdfe env_share bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t1.xls, append
reghdfe liberal_share bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t1.xls, append
reghdfe demreg bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t1.xls, append
reghdfe turnout bigfire if turnout<100, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t1.xls, append

*Make table 3
reghdfe biggovshare buff20k fivekonly bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t2.xls
reghdfe env_share buff20k fivekonly bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t2.xls, append
reghdfe liberal_share buff20k fivekonly bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t2.xls, append
reghdfe demreg buff20k fivekonly bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t2.xls, append
reghdfe turnout buff20k fivekonly bigfire if turnout<100, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t2.xls, append

*construct variables for table 4
gen indreg=bdcl/btotreg_r
egen indregdev=std(indreg)
egen demregdev=std(demreg)
gen repreg=(brep/btotreg_r)*100
egen repregdev=std(repreg)

*Make table 4
reghdfe biggovshare buff20k##c.demregdev fivekonly##c.demregdev bigfire##c.demregdev, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t3.xls


reghdfe biggovshare buff20k##c.repregdev fivekonly##c.repregdev bigfire##c.repregdev, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t3.xls, append
reghdfe env_share buff20k##c.demregdev fivekonly##c.demregdev bigfire##c.demregdev, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t3.xls, append

reghdfe env_share buff20k##c.repregdev fivekonly##c.repregdev bigfire##c.repregdev, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t3.xls, append

reghdfe liberal_share buff20k##c.demregdev fivekonly##c.demregdev bigfire##c.demregdev, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t3.xls, append
reghdfe liberal_share buff20k##c.repregdev fivekonly##c.repregdev bigfire##c.repregdev, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t3.xls, append

*Make table 7
reghdfe biggovshare placebo if everbuff==1 & (year<firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t6.xls
reghdfe env_share placebo if everbuff==1 & (year<firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t6.xls, append
reghdfe liberal_share placebo if everbuff==1 & (year<firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t6.xls, append
reghdfe demreg placebo if everbuff==1 & (year<firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t6.xls, append
reghdfe turnout placebo if turnout<100 & everbuff==1 & (year<firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t6.xls, append

*Make table 8
reghdfe biggovshare bigfire if everbuff==1 & (year<=firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t7.xls
reghdfe env_share bigfire if everbuff==1 & (year<=firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t7.xls, append
reghdfe liberal_share bigfire if everbuff==1 & (year<=firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t7.xls, append
reghdfe demreg bigfire if everbuff==1 & (year<=firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t7.xls, append
reghdfe turnout bigfire if turnout<100 & everbuff==1 & (year<=firstfire |everfire==0), absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t7.xls, append



*make table 5
reghdfe demshare bigfire if year<2012, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t4.xls
reghdfe incumshare bigfire if year<2012, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t4.xls, append
reghdfe demshare buff20k fivekonly bigfire if year<2012, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t4.xls, append
reghdfe incumshare buff20k fivekonly bigfire if year<2012, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t4.xls, append


*****************************************************************
*using code from Borusyak et al (2021) to implement DiD imputation,
* available on his GitHub
*************************************************************
gen i = bgkeynum					// unit id
gen t = year				// calendar period

tsset bgkeynum year, delta(2) //two year steps in this analysis!


gen Ei = firstfire if t==2002	// year when unit is first treated
bys bgkeynum (year): replace Ei = Ei[1]
gen K = year-Ei								// "relative time", i.e. the number periods since treated (could be missing if never-treated)
gen D = K>=0 &Ei!=. 						// treatment indicator

*Make Table 9
did_imputation biggovshare bgkeynum year Ei if everbuff==1 & year<=firstfire, fe(bgkeynum yearfe) horizons(0/0) autosample pretrends(3)
*outreg2 using t8.xls
	
did_imputation env_share bgkeynum year Ei if everbuff==1 & year<=firstfire, fe(bgkeynum yearfe) horizons(0/0) autosample pretrends(3)
*outreg2 using t8.xls, append

did_imputation liberal_share bgkeynum year Ei if everbuff==1 & year<=firstfire, fe(bgkeynum yearfe) horizons(0/0) autosample pretrends(3)
*outreg2 using t8.xls, append


replace fireyear=0 if fireyear==3000
by bgkeynum: egen fireyear2=max(fireyear)


****Implement the difference-in-difference multiple treatments of identical intensity
***endpoint-binning protocol of Schmidheiny and Siegloch (2019)
gen timedum=year-firstfire

replace timedum=timedum/2
replace timedum=. if sumfires==0

gen timedum2=year-fireyear2
replace timedum2=timedum2/2
replace timedum2=. if sumfires==0

**construct lags and leads according to Schmidheiny and Siegloch (2019)
gen l3=0
gen l2=0
gen l1=0
gen f0=0
gen f1=0
gen f2=0
replace l2=1 if timedum==-2|timedum2==-2
replace l1=1 if timedum==-1|timedum2==-1
replace f0=1 if timedum==0|timedum2==0
replace f1=1 if timedum==1|timedum2==1
replace f2=1 if (timedum>=2|timedum2>=2)&sumfires>0
replace f2=0 if sumfires==0
replace f2=2 if (timedum>=2&timedum2>=2) &sumfires>0
replace f2=0 if sumfires==0
replace l3=1 if timedum<=-3|timedum2<=-3
replace l3=2 if timedum<=-3&timedum2<=-3

*make panel 2 of figure 7
reghdfe env_share l3 l2 l1 f0 f1 f2 if everbuff==1 &sumfires<3 &year>2004&year<2016, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
matrix r1=r(table)

*store coefficients so they can be plotted
matrix list r1
matrix lag=J(1,6,.)
forvalues j=1(1)6{
 local coeffs = "`coeffs' b`j' se`j' lag`j'"
 }

display "`coeffs'"
postfile temp_coeffs2 `coeffs' using temp_coeffs2, replace
local values=""
forvalues j=1(1)6 {
 local values= "`values' (r1[1,`j']) (r1[2,`j']) (lag[1,`j'])"
 }
 display "`values'"
post temp_coeffs2 `values'

postclose temp_coeffs2

preserve
drop _all
use temp_coeffs2, clear
gen i=_n

*create confidence intervals
reshape long b se, i(i) j(pt)
gen c_lo=b-1.96*se
gen c_hi=b+1.96*se


*plot event study coefficients panel 2 figure 7
replace pt=(pt-4)*2
set scheme s2mono
twoway (rcap c_lo c_hi pt, color(black)) (scatter b pt, mc(black) mfc(black) m(circle) msiz(medsmall) xline(-1) yline(0,lw(thin)) lp(shortdash) title("Environmental Share Event Study", size(small)) legend(off) xtitle("Years from Fire Exposure") ytitle("Environmental Share Percentage Points") ylabel(-3(1)3) bgcolor(white) graphregion(color(white)) plotregion(ls(none)))
graph export t9_event_env.pdf, replace


restore
erase temp_coeffs2.dta
postutil clear


*make panel 1 of figure 7
reghdfe biggovshare l3 l2 l1 f0 f1 f2 if everbuff==1 &sumfires<3 &year>2004&year<2016, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
matrix r1=r(table)
matrix lag=J(1,6,.)
forvalues j=1(1)6{
 local coeffs = "`coeffs' b`j' se`j' lag`j'"
 }
 
display "`coeffs'"
postfile temp_coeffs1 `coeffs' using temp_coeffs1, replace
local values=""
forvalues j=1(1)6 {
 local values= "`values' (r1[1,`j']) (r1[2,`j']) (lag[1,`j'])"
 }
post temp_coeffs1 `values'
postclose temp_coeffs1

preserve
drop _all
use temp_coeffs1, clear
gen i=_n

*create confidence intervals
reshape long b se, i(i) j(pt)
gen c_lo=b-1.96*se
gen c_hi=b+1.96*se
*plot event study coefficients panel 1 figure 7
replace pt=(pt-4)*2
set scheme s2mono
twoway (rcap c_lo c_hi pt, color(black)) (scatter b pt, mc(black) mfc(black) m(circle) msiz(medsmall) xline(-1) yline(0,lw(thin)) lp(shortdash) title("Big Government Event Study", size(small)) legend(off) xtitle("Years from Fire Exposure") ytitle("Big Government Share Percentage Points") ylabel(-3(1)3) bgcolor(white) graphregion(color(white)) plotregion(ls(none)))
graph export t9_event_big.pdf, replace

restore
erase temp_coeffs1.dta

*make panel 3 of figure 7
reghdfe liberal_share l3 l2 l1 f0 f1 f2 if everbuff==1 &sumfires<3 &year>2004&year<2016, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
matrix r1=r(table)
matrix lag=J(1,6,.)
forvalues j=1(1)6{
 local coeffs = "`coeffs' b`j' se`j' lag`j'"
 }
 
display "`coeffs'"
postfile temp_coeffs3 `coeffs' using temp_coeffs3, replace
local values=""
forvalues j=1(1)6 {
 local values= "`values' (r1[1,`j']) (r1[2,`j']) (lag[1,`j'])"
 }
post temp_coeffs3 `values'

postclose temp_coeffs3

preserve
drop _all
use temp_coeffs3, clear
gen i=_n

*create confidence intervals
reshape long b se, i(i) j(pt)
gen c_lo=b-1.96*se
gen c_hi=b+1.96*se
*plot event study coefficients panel 3 figure 7
replace pt=(pt-4)*2
set scheme s2mono
twoway (rcap c_lo c_hi pt, color(black)) (scatter b pt, mc(black) mfc(black) m(circle) msiz(medsmall) xline(-1) yline(0,lw(thin)) lp(shortdash) title("Liberal Non Economic Event Study", size(small)) legend(off) xtitle("Years from Fire Exposure") ytitle("Liberal Non Economic Share Percentage Points") ylabel(-3(1)3) bgcolor(white) graphregion(color(white)) plotregion(ls(none)))
graph export t9_event_liberal.pdf, replace
restore
erase temp_coeffs3.dta

*define variables and make table 6
gen lnbig=ln(biggovshare)
gen lnbig2=ln(100-biggovshare)
gen lnbigd=lnbig-lnbig2
reghdfe lnbigd bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t9.xls, append

gen lnjoint=ln(env_share)
gen lnjoint2=ln(100-env_share)
gen lnjointd=lnjoint-lnjoint2
reghdfe lnjointd bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t9.xls, append

gen lnlib=ln(liberal_share)
gen lnlib2=ln(100-liberal_share)
gen lnlibd=lnlib-lnlib2
reghdfe lnlibd bigfire, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using t9.xls, append


*create variables to be used for propensity score matching appendix B
sort bgkeynum year
by bgkeynum: egen demreg2018=max(demreg) if year==2018
by bgkeynum: egen demreg18=min(demreg2018)
drop demreg2018

by bgkeynum: egen demreg2002=max(demreg) if year==2002
by bgkeynum: egen demreg02=min(demreg2002)
drop demreg2002
gen demchange=demreg18-demreg02

*Propensity score logit
logit everfire demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010
predict propscore



*Make Figure B1
twoway (histogram propscore if everfire==0 &year==2010, yla(, format(%5.0f) ang(h)) bcolor(gs14) frequency) (histogram propscore if everfire==1 &year==2010, bcolor(gs3) frequency xtitle("Propensity Score") graphregion(color(white)))
twoway (histogram propscore if everfire==0 &everbuff==1 &year==2010, yla(, format(%5.0f) ang(h)) bcolor(gs14) frequency) (histogram propscore if everfire==1 &year==2010, bcolor(gs3) frequency xtitle("Propensity Score") graphregion(color(white)))

*Make propensity score weights
psmatch2 everfire demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010
capture drop match
by bgkeynum: egen match=min(_weight)


*Begin creating summary stats table B1
estpost ttest demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010, by(everfire)
matrix t1=e(t)
forvalues j=1(1)7 {
local t1_`j': di %8.2f =t1[1,`j']
}

estpost summarize demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010 & everfire==0

matrix means_1 = e(mean)
matrix count_1 = e(count)
matrix sd_1 = e(sd)
local ct_1 = count_1[1,1]

*store relevant numbers in local variables so they can be called/inputted directly into latex
	forvalues j=1(1)7 {
		local means_1_`j': di %8.2f =means_1[1,`j']
		local sd_1_`j': di %8.2f =sd_1[1,`j']

	}
	
estpost summarize demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010 & everfire==1
	matrix means_2 = e(mean)
	matrix count_2 = e(count)
	matrix sd_2 = e(sd)
	local ct_2 = count_2[1,1]

*store relevant numbers in local variables so they can be called/inputted directly into latex
	forvalues j=1(1)7 {
		local means_2_`j': di %8.2f =means_2[1,`j']
		local sd_2_`j': di %8.2f =sd_2[1,`j']

	}

	
estpost ttest demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010 &match!=., by(everfire)
matrix t2=e(t)
forvalues j=1(1)7 {
local t2_`j': di %8.2f =t2[1,`j']
}

estpost summarize demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010 &match!=. & everfire==0

matrix means_3 = e(mean)
matrix count_3 = e(count)
matrix sd_3 = e(sd)
local ct_3 = count_3[1,1]

*store relevant numbers in local variables so they can be called/inputted directly into latex
	forvalues j=1(1)7 {
		local means_3_`j': di %8.2f =means_3[1,`j']
		local sd_3_`j': di %8.2f =sd_3[1,`j']

	}
	
estpost summarize demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens if year==2010 &match!=. & everfire==1
	matrix means_4 = e(mean)
	matrix count_4 = e(count)
	matrix sd_4 = e(sd)
	local ct_4 = count_4[1,1]

*store relevant numbers in local variables so they can be called/inputted directly into latex
	forvalues j=1(1)7 {
		local means_4_`j': di %8.2f =means_4[1,`j']
		local sd_4_`j': di %8.2f =sd_4[1,`j']

	}

*write table B1 to Latex	
file open sumstats_b using "sumstats_b.tex", write replace
file write sumstats_b "\begin{tabular}{lcccccc}"_n
file write sumstats_b " &    &     &  &	 &   \\"_n	

file write sumstats_b "& Ever Treated =0 (unmatched) & Ever Treated =1 (unmatched) & T-test & Ever Treated =0 (matched) & Ever Treated =1 (matched) & T-test \\ \midrule"_n	


local demchangeROW="Change in Share Democrats"
local demregROW="Share Democrats"
local per_cap10ROW="Per Capita Income"
local share_white10ROW="Share White"
local share_black10ROW="Share Black"
local share_housingunits10ROW="Share Owned Housing"
local popdensROW="Population Density"

local table_rows "demchange demreg per_cap10 share_white10 share_housingunits10 share_black10 popdens"

local counter=1

foreach varn of local table_rows {

	local `varn'ROW="``varn'ROW'" + "& `means_1_`counter''& `means_2_`counter''& `t1_`counter''& `means_3_`counter''& `means_4_`counter''&`t2_`counter''" 
	local `varn'seROW="" + "& (`sd_1_`counter'')& (`sd_2_`counter'')& & (`sd_3_`counter'')& (`sd_4_`counter'')& &" 

	file write sumstats_b "``varn'ROW' \\"_n
	file write sumstats_b "``varn'seROW' \\"_n			
				
	local counter = `counter' + 1
}
	
file write sumstats_b " &    &   &	&     & \\ \bottomrule"_n	
file write sumstats_b "\end{tabular}"_n
file close sumstats_b

*Make table B2
reghdfe biggovshare bigfire [fweight=match], absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using b2.xls
reghdfe env_share bigfire [fweight=match], absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using b2.xls, append
reghdfe liberal_share bigfire [fweight=match], absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using b2.xls, append
reghdfe demreg bigfire [fweight=match], absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using b2.xls, append
reghdfe turnout bigfire [fweight=match] if turnout<100, absorb(i.bgkeynum i.yearfe) vce(cluster bgkeynum)
*outreg2 using b2.xls, append


*Make Summary Statistics table 1 of main paper
estpost summarize biggovshare env_share liberal_share demreg repreg per_cap10 if everfire==0

matrix means_1 = e(mean)
matrix count_1 = e(count)
matrix sd_1 = e(sd)
local ct_1 = count_1[1,1]

*store relevant numbers in local variables so they can be called/inputted directly into latex
	forvalues j=1(1)6 {
		local means_1_`j': di %8.2f =means_1[1,`j']
		local sd_1_`j': di %8.2f =sd_1[1,`j']

	}
	
estpost summarize biggovshare env_share liberal_share demreg repreg per_cap10 if everfire==1
	matrix means_2 = e(mean)
	matrix count_2 = e(count)
	matrix sd_2 = e(sd)
	local ct_2 = count_2[1,1]

*store relevant numbers in local variables so they can be called/inputted directly into latex
	forvalues j=1(1)6 {
		local means_2_`j': di %8.2f =means_2[1,`j']
		local sd_2_`j': di %8.2f =sd_2[1,`j']

	}

	
*write sumstats table to latex	
file open sumstats using "sumstats.tex", write replace
file write sumstats "\begin{tabular}{lccc}"_n
file write sumstats " &    &      \\"_n	

file write sumstats "& Areas with No Fires & Areas with Fires \\ \midrule"_n	


local biggovROW="Mean Share of Vote on Initiatives that Expand Government"
local envROW="Mean Share of Vote on Environmental Initiatives"
local per_cap10ROW="Per Capita Income"
local liberalROW="Mean Share of Vote on Other Liberal Initiatives"
local demROW="Share Registered Democrats"
local repROW="Share Registered Republicans"


local table_rows "biggov env liberal dem rep per_cap10"

local counter=1

foreach varn of local table_rows {

	local `varn'ROW="``varn'ROW'" + "& `means_1_`counter''& `means_2_`counter''" 
	local `varn'seROW="" + "& (`sd_1_`counter'')& (`sd_2_`counter'')" 

	file write sumstats "``varn'ROW' \\"_n
	file write sumstats "``varn'seROW' \\"_n			
				
	local counter = `counter' + 1
}
	
file write sumstats "Observations &  `ct_1'  & `ct_2'  \\ \bottomrule"_n	
file write sumstats "\end{tabular}"_n
file close sumstats

***collapse to make descriptive figures
collapse env_share demreg repreg per_cap10 liberal_share biggovshare, by(everfire year)
replace repreg=repreg*100

drop if missing(everfire)

**make Figure 5
twoway (line env_share year if everfire==0) (line env_share year if everfire==1, lcolor(red) graphregion(color(white)) color(edkblue) ytitle("Environmental Share") xtitle("Year") title("Environmental Voting by Year and Fire Status"))
twoway (line biggovshare year if everfire==0) (line biggovshare year if everfire==1, lcolor(red) graphregion(color(white)) color(edkblue) ytitle("Big Gov Share") xtitle("Year") title("Larger Government Voting by Year and Fire Status"))

twoway (line liberal_share year if everfire==0) (line liberal_share year if everfire==1, lcolor(gray) graphregion(color(white)) color(edkblue) ytitle("Liberal Share") xtitle("Year") title("Liberal Voting by Year and Fire Status"))

*Make Figure 4
twoway (line demreg year if everfire==0) (line demreg year if everfire==1, lcolor(gray) graphregion(color(white)) color(edkblue) ytitle("Share Registerd Democrats") xtitle("Year") title("Share Registered Democrats by Year and Fire Status"))

***Figures 3 and 6 screen captures from ArcGIS. Figures 1 and 2 from CAL FIRE